package com.lovo.project2.converter;

import org.springframework.core.convert.converter.Converter;

import java.time.LocalDate;

public class ChangeConverter implements Converter<String, LocalDate> {
    @Override
    public LocalDate convert(String source) {
       if (source!=null||"".equals(source)){
         if (source.matches("/d{4}-/d{2}-/d{2}")) {
             return LocalDate.parse(source);
         }

          return null;
       }

return null;

    }
}
